package com.gnerv.battle.boot.project.guard.model.bo;

import com.gnerv.battle.boot.common.tools.DateTimeTools;
import com.gnerv.battle.boot.project.guard.model.entity.MonitorProjectNode;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class MonitorProjectNodeBO {

    private String ukId;
    private String projectUkId;
    private String hostUkId;
    private String datasourceUkId;
    private String middlewareUkId;
    private String middlewareConfig;
    private String name;
    private String configFile;
    private String status;
    private Integer sort;

    public MonitorProjectNode toCreateMonitorProjectNode(){
        MonitorProjectNode monitorProjectNode = new MonitorProjectNode();
        BeanUtils.copyProperties(this,monitorProjectNode);
        monitorProjectNode.setGmtCreate(DateTimeTools.currentTimeMillis());
        monitorProjectNode.setGmtModified(DateTimeTools.currentTimeMillis());
        return monitorProjectNode;
    }

    public MonitorProjectNode toUpdateMonitorProjectNode(){
        MonitorProjectNode monitorProjectNode = new MonitorProjectNode();
        BeanUtils.copyProperties(this,monitorProjectNode);
        monitorProjectNode.setGmtModified(DateTimeTools.currentTimeMillis());
        return monitorProjectNode;
    }

}

